<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title><#if entity.shopId??>编辑<#else>新增</#if>店铺信息</title>
    <#include "/view/admin/head.html"/>
    <script type="text/javascript" src="${base}/jstool/bootstrap-fileinput/js/fileinput.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-fileinput/js/locals/zh.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-fileinput/css/fileinput.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-switch/bootstrap-switch.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-switch/bootstrap-switch.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />


    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/js/bootstrapValidator.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/lang/zh_CN.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-validator-0.5.3/css/bootstrapValidator.min.css" />


    <style type="text/css">
        .list-path {
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;
        }

        .table-class {
            width: 90%;
            text-align: center;
            border: 1px solid #afd9ee;
            margin: 0 auto;
            margin-top: 50px;
        }

        table th {
            width: 20%;
            background-color: #d9edf7;
            text-align: right;
        }

        table td {
            width: 20%;
            text-align: left;
        }


    </style>
    <script type="text/javascript">

        $(function(){
            //初始化




                $('#picPath').fileinput({
                    language: 'zh', //设置语言
                    allowedFileExtensions : ['jpg', 'png','gif'],//接收的文件后缀
                    showUpload: false, //是否显示上传按钮
                    showCaption: false,//是否显示标题
                    browseClass: "btn btn-primary", //按钮样式
                    previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
                });
                $('#updateDate').datetimepicker();
                $('#createtime').datetimepicker();
                    $('[name="displaycb"]').bootstrapSwitch({
                                onText:"是",
                                offText:"否",
                        onColor:"success",
                        offColor:"info",
                        size:"small",
                        onSwitchChange:function(event,state){
                            if(state==true){
                                $(this).val("1");
                                $('[name="display"]').val("1");
                            }else{
                                $(this).val("0");
                                $('[name="display"]').val("0");
                            }
                        }
                    });






            $('#shopForm').bootstrapValidator({
                message: 'This value is not valid',
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {



                    
                title:{
                    message: '输入标题出错',
                    validators:{
                        notEmpty: {
                            message: '标题不能为空'
                        },
                        stringLength:{
                            max: 50,
                            message: '标题不能超过 50个字符'
                        }
                    }
                }

                    ,
                prices:{
                        message: '输入价格出错',
                        validators:{
                            notEmpty: {
                                message: '价格不能为空'
                            },
                            stringLength:{
                                max: 11,
                                message: '价格不能超过 11个字符'
                            },
                            regexp: {
                                regexp: /^[1-9][0-9]*$|^[1-9][0-9]*\.[0-9]{1,2}$|^0\.[0-9]{1,2}$/,
                                message:'价格只能是金额'
                            }
                        }
                    }


                    ,
                order:{
                    message: '输入顺序出错',
                    validators:{
                        notEmpty: {
                            message: '顺序不能为空'
                        },
                        stringLength:{
                            max: 11,
                            message: '顺序不能超过 11个字符'
                        },
                        regexp: {
                            regexp: /^[0-9]+$/,
                                    message:'顺序只能是数字'
                        }
                    }
                }














                }
            });


        });

    </script>
</head>
<body>

<div class="list-path">
		<span style="margin-left: 50px;"> <a
                href="${base}/shop/list.do"><span
                class="glyphicon glyphicon-home"></span> 店铺信息列表</a> / <#if entity.shopId??>编辑<#else>新增</#if>店铺信息
		</span>
    <div style="float: right; margin-right: 40px;">
        <a class="btn btn-info"
           href="${base}/shop/list.do">返回上一级</a>
    </div>
</div>


<div class="table-class">
    <#include "/view/admin/opermsg.html"/>
    <form id="shopForm" action="${base}/shop/save.do"
     method="post" enctype="multipart/form-data"  >
    <table class="table table-bordered">

                        <input type="hidden" style="display: none" name="shopId" value="${entity.shopId!}"/>


                <tr>
                <th>标题</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="title" name="title" placeholder="请输入标题" value="${entity.title!}">
                    </div>
                </td>
                

                
                <th>价格</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="prices" name="prices" placeholder="请输入价格" value="${entity.prices!}">
                    </div>
                </td>
                </tr>

                <tr>
                <th>顺序</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="order" name="order" placeholder="请输入顺序" value="${entity.order!}">
                    </div>
                </td>
                

                
                <th>图片地址</th>
                <td>
            <#if entity.picPath??>
                        <img src="${base}${entity.picPath!}" height="100px">
            </#if>

                    <input type="file" class="form-control" id="picPath" name="filePicPath" >
                </td>
                </tr>

                <tr>
                <th>更新时间</th>
                <td>
                    <input type="text" class="form-control" value="<#if (entity.updateDate)?? >${entity.updateDate?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="updateDate" name="updateDate" data-date-format="yyyy-mm-dd hh:ii:ss">
                </td>
                

                
                <th>创建时间</th>
                <td>
                    <input type="text" class="form-control" value="<#if (entity.createtime)?? >${entity.createtime?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createtime" name="createtime" data-date-format="yyyy-mm-dd hh:ii:ss">
                </td>
                </tr>

                <tr>
                <th>显示或隐藏</th>
                <td>
                <input name="display" type="hidden" value="<#if entity.display??>${entity.display}<#else>0</#if>"/>
                <input name="displaycb" type="checkbox"  data-size="small"
                       <#if entity.display??>
                        <#if 1==entity.display>
                            checked="checked"
                            value="1"</#if>
                        <#if 0==entity.display>
                            value="0"</#if>
                </#if>/>
                </td>
                



                
                <th>类型</th>
                <td>
                    <div class="form-group">
                        <select id="type" name="type"
                                class="form-control"
                        >
                            <option value="">请选择类型</option>
                                            <option value="0" <#if entity.type??&&0 == entity.type>selected="selected"</#if>>审批中</option>

                                            <option value="1" <#if entity.type??&&1 == entity.type>selected="selected"</#if>>审批通过</option>

                                            <option value="2" <#if entity.type??&&2 == entity.type>selected="selected"</#if>>审批不通过</option>


                        </select>
                    </div>
                </td>
                </tr>

                <tr>
                <th>分类</th>
                <td>
                    <div class="form-group">
                        <select id="classify" name="classify"
                                class="form-control selectpicker"   data-live-search="true"
                        >
                            <option value="">请选择分类</option>
                                    <#list listClassify as lv>
                                        <option value="${lv.value!}"
                                        <#if lv.value??&&entity.classify??&&entity.classify == lv.value >
                                            selected="selected"
                                        </#if>
                                            >${lv.name!}</option>
                                    </#list>

                        </select>
                    </div>
                </td>
                

                
                <th>类分类</th>
                <td>
                    <div class="form-group">
                        <select id="classType" name="classType"
                                class="form-control selectpicker"   data-live-search="true"
                        >
                            <option value="">请选择类分类</option>
                                    <#list listClassType as lv>
                                        <option value="${lv.value!}"
                                        <#if lv.value??&&entity.classType??&&entity.classType == lv.value >
                                            selected="selected"
                                        </#if>
                                            >${lv.name!}</option>
                                    </#list>

                        </select>
                    </div>
                </td>
                </tr>


        <tr>
            <td colspan="4" width="100%" style="text-align: center;">
                <input type="submit" class="btn btn-success " value="保存"/>
                <span style="width: 20px;">&nbsp;</span>
                <a class="btn btn-danger " href="javascript:window.history.go(-1)">
                   </span>返回</a>
            </td>
        </tr>

    </table>
</form>




</div>

<script type="text/javascript">

</script>


</body>
</html>
